<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>修改密码</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../css/common.css"/>
    <link rel="stylesheet" href="../css/main.css"/>
</head>
<body>
    <article>
        <label class="flex_a h100 bw plr24 bdb">
            <span>原密码:</span>
            <input type="password" class="flex1 ml20" placeholder="请输入" id="password">
        </label>
        <label class="flex_a h100 bw plr24 bdb">
            <span>新密码:</span>
            <input type="password" class="flex1 ml20" placeholder="请输入" id="newPassword">
        </label>
        <label class="flex_a h100 bw plr24">
            <span>再次输入新密码:</span>
            <input type="password" class="flex1 ml20" placeholder="请输入" id="rePassword">
        </label>
        <div class="plr30 mt100">
            <button class="border-r6 bgc1 colw tac lh90 pw100 btn_tap">立即修改</button>
        </div>
    </article>
</body>
</html>
<script src="../js/jquery-1.8.3.min.js"></script>
<script src="../js/dlc.js"></script>
<script>
    var onOff = 0;
    $('.btn_tap').click(function(){
        if(onOff)return false;
        var password = $('#password').val();
        var newPassword = $('#newPassword').val();
        var rePassword = $('#rePassword').val();
        if(isNull(password)){
            dlctipbox.show('请输入原密码..');
        }else if(isNull(newPassword)){
            dlctipbox.show('请输入新密码..');
        }else if(isNull(rePassword)){
            dlctipbox.show('请输入确认密码..');
        }else if(newPassword != rePassword){
            dlctipbox.show('新密码与确认密码不一致');
        }else{
            onOff = 1;
            dlc_request('/api/agent/updatePwd',{'password':password,'newPassword':newPassword,'rePassword':rePassword},function(res){
                console.log(res);
                if(res.code == 1){
                    dlctipbox.show('修改成功');
                    setTimeout(function(){
                        history.go(-1);
                    },2000);
                }else{
                    onOff = 0;
                    dlctipbox.show(res.msg);
                }
            });
        }
    });
</script>






















